<template>
  <div class="product-add" v-loading="loading">
    <!-- <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="企业介绍" name="basic"></el-tab-pane>
      <el-tab-pane label="企业文化" name="culture"></el-tab-pane>
      <el-tab-pane label="团队风采" name="team"></el-tab-pane>
      <el-tab-pane label="公司管理" name="manager"></el-tab-pane>
    </el-tabs> -->
    <!--form表单-->
    <el-form>
      <!--内容-->
      <el-form-item label="">
        <div class="edit_container">
          <Uediter v-model="form.culture" ref="ue"></Uediter>
        </div>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submit">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts" setup>
import { computed, onMounted, ref, watch } from "vue";
import { getCompany, setCompany } from "@/api/company";
import Uediter from "@/components/UE.vue";
import { ElMessage } from "element-plus";
const activeName = ref("culture");
const loading = ref(false);
const company = ref({
  app_id: 0,
  basic: "",
  culture: "",
  team: "",
  manager: "",
});
const ue = ref<any>(null);
const form = ref({
  culture: "",
});
const contentChangeFunc = (e: string) => {
  form.value.culture = e;
};
onMounted(() => {
  getCompany().then((res: any) => {
    company.value = res.data;
    form.value.culture = company.value.culture;
  });
});

const submit = () => {
  setCompany(form.value).then((res: any) => {
    if (res.code == 1) {
      ElMessage.success("保存成功");
    } else {
      ElMessage.error(res.msg);
    }
  });
};
</script>

<style lang="scss" scoped>
.product-add {
  padding-bottom: 50px;
}

.mb50 {
  margin-bottom: 50px;
}
</style>
